#ifndef __PAGE_H
#define __PAHE_H

#include "types.h"

#define PAGE_ORDER	12
#define PAGE_SIZE	4096

#define PAGE_TAKEN		(uint8_t)(1 << 0)
#define PAGE_RELEASE	(uint8_t)(0)
#define PAGE_LAST		(uint8_t)(1 << 1)


/*
 * page_t Descriptor
 * flags:
 * - bit 0: flag if this page is taken(allocated)
 * - bit 1: flag if this page is the last page of the memory block allocated
 */
struct page_t {
	uint8_t flags;
};


void page_init();
void page_free(void *p);
void *page_alloc(uint64_t npages);
#endif
